import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'

const store = Vuex.createStore({
    state,
    mutations
});

export default store;

// import Vuex from 'vuex'
//
// const USER = "USER";
// let defaultCity = '北京'
// try {
//     if (localStorage.city) {
//         defaultCity = localStorage.city
//     }
// } catch (e) {
// }
//
// const store = Vuex.createStore({
//     state: {
//         user: SessionStorage.get(USER) || {},
//         city: defaultCity
//     },
//     mutations: {
//         setUser(state, user) {
//             state.user = user;
//             console.log(user)
//             SessionStorage.set(USER, user);
//         },
//         changeCity(state, city) {
//             state.city = city
//             try {
//                 localStorage.city = city
//             } catch (e) {
//             }
//         }
//     },
//     actions: {},
//     modules: {}
// })
